<!DOCTYPE html>
<html lang="en">
	<head>
	    <meta charset="UTF-8">
	    <meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	    <title>建新街道移动办公 - E事通</title>
	    <link rel="stylesheet" href="/app/static/layui/css/layui.css">
	    <link rel="stylesheet" href="/app/static/styles/style.css">
	    <link rel="icon" href="image/code.png">
	    <script src="/app/static/scripts/jquery-1.9.1.js"></script>
	    <script type="text/javascript" src="/app/static//layui/layui.all.js"></script>
		<script type="text/javascript" src="/app/static/scripts/index.js"></script>
	</head>

	<body class="body">
		<div class="section">
			<div class="wrapper-md">
		       	<h1 class="fl" id="title">个人中心</h1>
		       </div>
		   </div>
		</div>
		<div class="section-content">
			<a href="javascript:history.go(-1);" class="layui-btn">返回</a>			
			<form class="layui-form mt20 layui-form-labelw100" style="width: 500px;">
				<div class="layui-form-item">
					<label class="layui-form-label">用户头像</label>
					<div class="layui-input-block">
						<div class="img-box">
							<img src="" id="showAvatar"/>
						</div>
						<div class="def_uploadFile">
						    <div class="def_uploadBtn">选择</div>
						    <input type="file" id="avatarFile">
						</div>
						<div class="def_uploadFile">
						    <div class="def_uploadBtn">清除</div>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><i class="must_star">*</i>登录名</label>
					<div class="layui-input-block layui-input-readonly">
						wangduoduo
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><i class="must_star">*</i>真实姓名</label>
					<div class="layui-input-block layui-input-readonly">
						王娜
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><i class="must_star">*</i>手机号码</label>
					<div class="layui-input-block">
						<input type="text" lay-verify="required"  class="layui-input" value="1111111">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><i class="must_star">*</i>登录密码</label>
					<div class="layui-input-block">
						<p>
							<div class="layui-form-mid">
								********
								<a href="javascript:;" onclick="showChangePwd()" style="color:#1E9FFF">修改密码</a>
							</div>
						</p>
					</div>
				</div>
				
				<div class="layui-form-item" style="display: none;" id="changePasswordWrapper">
					<div class="layui-form-item">
						<label class="layui-form-label">旧密码</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input">
						</div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label">新密码</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input">
						</div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label">确认新密码</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input">
						</div>
					</div>
				</div>
				
	
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button type="submit" class="layui-btn" lay-submit>更新</button>
					</div>
				</div>
			</form>
		</div>
		
		
		
		<script type="text/javascript">
			var form = layui.form,
				layer = layui.layer,
				laypage = layui.laypage,
				layedit = layui.layedit,
				laydate = layui.laydate;
				
				form.render()
			
			
				$('body').delegate('#avatarFile','change',function(){
				  	var objUrl = getObjectURL(this.files[0]) ;  
				  	$('#showAvatar').attr('src',objUrl)
			  	})
		  
		
		
				//建立一個可存取到該file的url  
				function getObjectURL(file) {
					var url = null;
					// 下面函数执行的效果是一样的，只是需要针对不同的浏览器执行不同的 js 函数而已  
					if(window.createObjectURL != undefined) { // basic  
						url = window.createObjectURL(file);
					} else if(window.URL != undefined) { // mozilla(firefox)  
						url = window.URL.createObjectURL(file);
					} else if(window.webkitURL != undefined) { // webkit or chrome  
						url = window.webkitURL.createObjectURL(file);
					}
					return url;
				}
			
				
				function showChangePwd(){
					$('#changePasswordWrapper').show();
					return false;
				}
			
		</script>
	</body>
</html>